3.31 \(\int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx\)

Optimal. Leaf size=55 \[ \frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} f (a+b)}-\frac {\tanh ^{-1}(\cos (e+f x))}{f (a+b)} \]

[Out]

-arctanh(cos(f*x+e))/(a+b)/f+arctan(cos(f*x+e)*a^(1/2)/b^(1/2))*b^(1/2)/(a+b)/f/a^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {4133, 481, 206, 205} \[ \frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} f (a+b)}-\frac {\tanh ^{-1}(\cos (e+f x))}{f (a+b)} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

(Sqrt[b]*ArcTan[(Sqrt[a]*Cos[e + f*x])/Sqrt[b]])/(Sqrt[a]*(a + b)*f) - ArcTanh[Cos[e + f*x]]/((a + b)*f)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 481

Int[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> -Dist[(a*e^n)/(b*c -
a*d), Int[(e*x)^(m - n)/(a + b*x^n), x], x] + Dist[(c*e^n)/(b*c - a*d), Int[(e*x)^(m - n)/(c + d*x^n), x], x]
/; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LeQ[n, m, 2*n - 1]

Rule 4133

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = F
reeFactors[Cos[e + f*x], x]}, -Dist[ff/f, Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*(ff*x)^n)^p)/(ff*x)^(n*
p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p
]

Rubi steps

\begin {align*} \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {x^2}{\left (1-x^2\right ) \left (b+a x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (e+f x)\right )}{(a+b) f}+\frac {b \operatorname {Subst}\left (\int \frac {1}{b+a x^2} \, dx,x,\cos (e+f x)\right )}{(a+b) f}\\ &=\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b) f}-\frac {\tanh ^{-1}(\cos (e+f x))}{(a+b) f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.76, size = 239, normalized size = 4.35 \[ \frac {\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sin (e) \tan \left (\frac {f x}{2}\right ) \left (-\sqrt {a}-i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right )+\cos (e) \left (\sqrt {a}-\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right )}{\sqrt {a}}+\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sin (e) \tan \left (\frac {f x}{2}\right ) \left (-\sqrt {a}+i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right )+\cos (e) \left (\sqrt {a}+\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right )}{\sqrt {a}}+\log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{f (a+b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

((Sqrt[b]*ArcTan[((-Sqrt[a] - I*Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a]
 - Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2]*Tan[(f*x)/2]))/Sqrt[b]])/Sqrt[a] + (Sqrt[b]*ArcTan[((-Sqrt[a] + I*S
qrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a] + Sqrt[a + b]*Sqrt[(Cos[e] - I*S
in[e])^2]*Tan[(f*x)/2]))/Sqrt[b]])/Sqrt[a] - Log[Cos[(e + f*x)/2]] + Log[Sin[(e + f*x)/2]])/((a + b)*f)

________________________________________________________________________________________

fricas [A]  time = 0.76, size = 156, normalized size = 2.84 \[ \left [\frac {\sqrt {-\frac {b}{a}} \log \left (-\frac {a \cos \left (f x + e\right )^{2} + 2 \, a \sqrt {-\frac {b}{a}} \cos \left (f x + e\right ) - b}{a \cos \left (f x + e\right )^{2} + b}\right ) - \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )} f}, \frac {2 \, \sqrt {\frac {b}{a}} \arctan \left (\frac {a \sqrt {\frac {b}{a}} \cos \left (f x + e\right )}{b}\right ) - \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )} f}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(-b/a)*log(-(a*cos(f*x + e)^2 + 2*a*sqrt(-b/a)*cos(f*x + e) - b)/(a*cos(f*x + e)^2 + b)) - log(1/2*c
os(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/((a + b)*f), 1/2*(2*sqrt(b/a)*arctan(a*sqrt(b/a)*cos(f*x +
e)/b) - log(1/2*cos(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/((a + b)*f)]

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(1/(4*a+4*b)*ln(abs(1-cos(f*x+exp(1)))/abs(1+cos(f*x+exp(1
))))-2*b*1/4/(a+b)/sqrt(a*b)*atan((-a*cos(f*x+exp(1))+b)/(sqrt(a*b)*cos(f*x+exp(1))+sqrt(a*b))))

________________________________________________________________________________________

maple [A]  time = 0.78, size = 76, normalized size = 1.38 \[ \frac {b \arctan \left (\frac {a \cos \left (f x +e \right )}{\sqrt {a b}}\right )}{f \left (a +b \right ) \sqrt {a b}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{f \left (2 a +2 b \right )}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{f \left (2 a +2 b \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)/(a+b*sec(f*x+e)^2),x)

[Out]

1/f*b/(a+b)/(a*b)^(1/2)*arctan(a*cos(f*x+e)/(a*b)^(1/2))+1/f/(2*a+2*b)*ln(-1+cos(f*x+e))-1/f/(2*a+2*b)*ln(1+co
s(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 64, normalized size = 1.16 \[ \frac {\frac {2 \, b \arctan \left (\frac {a \cos \left (f x + e\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\cos \left (f x + e\right ) + 1\right )}{a + b} + \frac {\log \left (\cos \left (f x + e\right ) - 1\right )}{a + b}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

1/2*(2*b*arctan(a*cos(f*x + e)/sqrt(a*b))/(sqrt(a*b)*(a + b)) - log(cos(f*x + e) + 1)/(a + b) + log(cos(f*x +
e) - 1)/(a + b))/f

________________________________________________________________________________________

mupad [B]  time = 0.21, size = 123, normalized size = 2.24 \[ -\frac {\mathrm {atanh}\left (\frac {\cos \left (e+f\,x\right )\,\left (2\,a^3+2\,a\,b^2\right )-\frac {\cos \left (e+f\,x\right )\,\left (8\,a^5+8\,a^4\,b-8\,a^3\,b^2-8\,a^2\,b^3\right )}{4\,{\left (a+b\right )}^2}}{2\,a\,b\,\left (a+b\right )}\right )}{f\,\left (a+b\right )}-\frac {\mathrm {atanh}\left (\frac {\cos \left (e+f\,x\right )\,\sqrt {-a\,b}}{b}\right )\,\sqrt {-a\,b}}{f\,\left (a^2+b\,a\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(e + f*x)*(a + b/cos(e + f*x)^2)),x)

[Out]

- atanh((cos(e + f*x)*(2*a*b^2 + 2*a^3) - (cos(e + f*x)*(8*a^4*b + 8*a^5 - 8*a^2*b^3 - 8*a^3*b^2))/(4*(a + b)^
2))/(2*a*b*(a + b)))/(f*(a + b)) - (atanh((cos(e + f*x)*(-a*b)^(1/2))/b)*(-a*b)^(1/2))/(f*(a*b + a^2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\csc {\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)**2),x)

[Out]

Integral(csc(e + f*x)/(a + b*sec(e + f*x)**2), x)

________________________________________________________________________________________